/*
** my_strstr.c for my_strstr in /home/labonn_c//Documents/piscine/Jour_O6
** 
** Made by christophe labonnemartinez
** Login   <labonn_c@epitech.net>
** 
** Started on  Mon Oct 10 11:35:52 2011 christophe labonnemartinez
** Last update Tue Nov  1 12:57:18 2011 christophe labonnemartinez
*/

char	*my_strstr(char *str, char *to_find)
{
  int	i;
  int	j;
  int	k;
  int	length;

  i = 0;
  j = 0;
  k = 0;
  length = my_strlen(to_find);
  if (to_find == "")
    return (str);
  while (str[i] != '\0' && to_find[j] != '\0')
    {
      if (str[i] == to_find[j])
	{
	  j = j + 1;
	  k = k + 1;
	}
      else
	j = 0;
      if (k == length)
	return (&str[i]);
      i = i + 1;
    }
}
